#include "stdafx.h"
#include "PlayerObject.h"


PlayerObject::PlayerObject()
{
	m_scale = 0.9f;
	m_lifeType = LifeType::player;
}


PlayerObject::~PlayerObject()
{
}

PlayerObject::PlayerObject(MuType::CharacterClass muclass, Camera *camera, Shader *shader)
{
	Init(muclass, camera, shader);
}

void PlayerObject::Init(MuType::CharacterClass muclass, Camera *camera, Shader *shader)
{
	auto mdls_player = Models_player::GetInstance();
	int mdls_count;
	auto mdls = mdls_player->GetBody(muclass, &mdls_count);
	RenderObject::Init(camera, mdls_count);
	//SetBoundBox(glm::vec3(-50, -50, -50), glm::vec3(50, 50, 50));
	SetBoundBox(mdls_player->m_boundingBoxMin, mdls_player->m_boundingBoxMax);
	m_animate.SetAnimData(mdls_player->GetPlayerAnimation());
	m_animate.SetInterpolation(true);
	m_muClass = muclass;
	//m_animate.SetAnimation(4, 0);
	//UseLight(0);
	for (int i = 0; i < mdls_count; i++) SetMesh(i, &mdls[i].m_vaoMesh, mdls[i].m_materials, shader);
}